home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).adf / Include / DOS.i < prev    next >
Text File  |  1989-07-02  |  6KB  |  222 lines

  1.  
  2.     { These are the definitions for the DOS library.  Note that a
  3.       couple routine names had to be changed since they conflict
  4.       with Pascal function names.
  5.  
  6.       Note, by the way, that you do not need to open the DOS library
  7.       before you use these.  The startup code requires the DOS, and
  8.       thus opens it, so the implementation for this library just uses
  9.       that pointer.  }
  10.  
  11.  
  12. const
  13. {    DOSTrue    = -1;
  14.     DOSFalse    = 0;     Same as in Pascal...}
  15.  
  16.     ModeReadWrite = 1004;    { Open old file with exclusive lock }
  17.     ModeOldFile    = 1005;
  18.     ModeNewFile = 1006;
  19.  
  20.     OffsetBeginning = -1;
  21.     OffsetCurrent   =  0;
  22.     OffsetEnd       =  1;
  23.  
  24.     SharedLock      = -2;
  25.     ExclusiveLock   = -1;
  26.     AccessRead      = SharedLock;
  27.     AccessWrite     = ExclusiveLock;
  28.  
  29.     TicksPerSecond = 50;
  30.  
  31. type
  32.  
  33.     DateStampRec = record
  34.     dsDays   : Integer;
  35.     dsMinute : Integer;
  36.     dsTick   : Integer;
  37.     end;
  38.  
  39.     FileHandle = Address;
  40.     FileLock   = Address;
  41.     FileInfoBlock = record    { Must be on 4-byte boundary }
  42.     fibDiskKey    : Integer;
  43.     fibDirEntryType    : Integer;
  44.     fibFileName    : Array [0..107] of Char;
  45.     fibProtection    : Integer;
  46.     fibEntryType    : Integer;
  47.     fibSize        : Integer;
  48.     fibNumBlocks    : Integer;
  49.     fibDate        : DateStampRec;
  50.     fibComment    : Array [0..79] of Char;
  51.     fibReserved    : Array [0..35] of Char;
  52.     end;
  53.     FileInfoBlockPtr = ^FileInfoBlock;
  54.  
  55. const
  56.     FIBB_SCRIPT    = 6;
  57.     FIBB_PURE    = 5;
  58.     FIBB_ARCHIVE = 4;
  59.     FIBB_READ    = 3;
  60.     FIBB_WRITE    = 2;
  61.     FIBB_EXECUTE = 1;
  62.     FIBB_DELETE    = 0;
  63.     FIBF_SCRIPT = $00000040;
  64.     FIBF_PURE    = $00000020;
  65.     FIBF_ARCHIVE = $0000010;
  66.     FIBF_READ    = $00000008;
  67.     FIBF_WRITE    = $00000004;
  68.     FIBF_EXECUTE = $00000002;
  69.     FIBF_DELETE = $00000001;
  70.  
  71. type
  72.  
  73.     InfoData = record    { Also must be a four-byte boundary }
  74.     idNumSoftErrors    : Integer;
  75.     idUnitNumber    : Integer;
  76.     idDiskState    : Integer;
  77.     idNumBlocks    : Integer;
  78.     idNumBlocksUsed    : Integer;
  79.     idBytesPerBlock    : Integer;
  80.     idDiskType    : Integer;
  81.     idVolumeNode    : Address;
  82.     idInUse        : Integer;
  83.     end;
  84.     InfoDataPtr = ^InfoData;
  85.  
  86. const
  87.  
  88.     IDWriteProtected    = 80;
  89.     IDValidating    = 81;
  90.     IDValidated        = 82;
  91.  
  92.     { Errors, from IoErr() and other sources... }
  93.  
  94.     ErrorNoFreeStore    = 103;
  95.     ErrorTaskTableFull    = 105;
  96.     ErrorLineTooLong    = 120;
  97.     ErrorFileNotObject    = 121;
  98.     ErrorInvalidResidentLibrary = 122;
  99.     ErrorNoDefaultDir    = 201;
  100.     ErrorObjectInUse    = 202;
  101.     ErrorObjectExists    = 203;
  102.     ErrorDirNotFound    = 204;
  103.     ErrorObjectNotFound    = 205;
  104.     ErrorBadStreamName    = 206;
  105.     ErrorObjectTooLarge    = 207;
  106.     ErrorActionNotKnown    = 209;
  107.     ErrorInvalidComponentName = 210;
  108.     ErrorInvalidLock    = 211;
  109.     ErrorObjectWrongType = 212;
  110.     ErrorDiskNotValidated = 213;
  111.     ErrorDiskWriteProtected = 214;
  112.     ErrorRenameAcrossDevices = 215;
  113.     ErrorDirectoryNotEmpty = 216;
  114.     ErrorTooManyLevels    = 217;
  115.     ErrorDeviceNotMounted = 218;
  116.     ErrorSeekError    = 219;
  117.     ErrorCommentTooBig    = 220;
  118.     ErrorDiskFull    = 221;
  119.     ErrorDeleteProtected = 222;
  120.     ErrorWriteProtected = 223;
  121.     ErrorReadProtected    = 224;
  122.     ErrorNotADOSDisk    = 225;
  123.     ErrorNoDisk        = 226;
  124.     ErrorNoMoreEntries    = 232;    { ExNext() }
  125.  
  126.     { These are conventional values for DOS command return codes }
  127.  
  128.     ReturnOK    = 0;
  129.     ReturnWarn    = 5;
  130.     ReturnError    = 10;
  131.     ReturnFail    = 20;
  132.  
  133.     { Bit numbers of break signals }
  134.  
  135.     SigBreakBCtrlC = 12;
  136.     SigBreakBCtrlD = 13;
  137.     SigBreakBCtrlE = 14;
  138.     SigBreakBCtrlF = 15;
  139.  
  140.     { Corresponding bit values }
  141.  
  142.     SigBreakFCtrlC = $00001000;
  143.     SigBreakFCtrlD = $00002000;
  144.     SigBreakFCtrlE = $00004000;
  145.     SigBreakFCtrlF = $00008000;
  146.  
  147. { This first function is, of course, not an AmigaDOS function.  What
  148. it does is return the FileHandle of a normal PCQ file, in case you
  149. want to do a Seek() or some other DOS function on it.  If your file
  150. is a type other than Text, just modify this declaration (it doesn't
  151. actually matter what file type is used).
  152.     The only thing to keep in mind is that PCQ files always have the
  153. next element buffered.  Thus if you are going to mess with the file,
  154. you should get the buffered element ( using filevar^ ) then, after
  155. you have finished messing with it, fix the buffer with a call like
  156. 'get(filevar)'.  }
  157.  
  158. Function GetFileHandle(VAR f : Text): FileHandle;
  159.     external;
  160. Procedure DOSClose(f : FileHandle);
  161.     external;
  162. Function CreateDir(s : String): FileLock;
  163.     external;
  164. Function CurrentDir(l : FileLock): FileLock;
  165.     external;
  166. Function DeleteFile(s : String): Boolean;
  167.     external;
  168. Function DupLock(l : FileLock): FileLock;
  169.     external;
  170. Function Examine(l : FileLock; f : FileInfoBlockPtr): Boolean;
  171.     external;
  172. Function ExNext(l : FileLock; f : FileInfoBlockPtr): Boolean;
  173.     external;
  174. Function Info(l : FileLock; i : InfoDataPtr): Boolean;
  175.     external;
  176. Function DOSInput() : FileHandle;
  177.     external;
  178. Function IoErr() : Integer;
  179.     external;
  180. Function IsInteractive(f : FileHandle): Boolean;
  181.     external;
  182. Function Lock(s : String; a : Integer): FileLock;
  183.     external;
  184. Function DOSOpen(s : String; a : Integer) : FileHandle;
  185.     external;
  186. Function DOSOutput() : FileHandle;
  187.     external;
  188. Function ParentDir(l : FileLock): FileLock;
  189.     external;
  190. Function DOSRead(f : FileHandle; b : Address; l : Integer) : Integer;
  191.     external;
  192. Function Rename(o, n : String) : Boolean;
  193.     external;
  194. Function Seek(f : FileHandle; p : Integer; m : Integer) : Integer;
  195.     external;
  196. Function SetComment(s, n : String): Boolean;
  197.     external;
  198. Function SetProtection(s : String; m : Integer): Boolean;
  199.     external;
  200. Procedure UnLock(l : FileLock);
  201.     external;
  202. Function WaitForChar(f : FileHandle; t : Integer): Boolean;
  203.     external;
  204. Function DOSWrite(f : FileHandle; b : Address; l : Integer) : Integer;
  205.     external;
  206. Function CreateProc(n : String; p: Integer; s : Address; t : Integer): Address;
  207.     external;
  208. Procedure DateStamp(var v : DateStampRec);
  209.     external;
  210. Procedure Delay(t : Integer);
  211.     external;
  212. Function DeviceProc(n : String): Address;
  213.     external;
  214. Procedure DOSExit(r : Integer);
  215.     external;
  216. Function Execute(s : String; i, o : FileHandle): Boolean;
  217.     external;
  218. Function LoadSeg(n : String): Address;
  219.     external;
  220. Procedure UnLoadSeg(s : Address);
  221.     external;
  222.